* using "C:\Users\gwcox\Desktop\PEOPLE\Acharya\gamsons law\interwar-data\all2-formateurs-only.dta"
* data have one obs per country-year with gaps (when no formateur formed a govt)
* if multiple formateurs in a give country-year, then meanover gives the average overrepresentation of the formateurs in that c-y
sort cid year
tsset cid year

* All countries that began as constitutional monarchies
* MAIN MODEL / fe
* All cases that began with a monarch
xtreg meanover I.year strong_nominator war invest if monarchy==1,fe vce(cl cid)
xtreg meanover I.year strong_nominator war invest if monarchy==1,re vce(cl cid)

* Figure 1 / showing the formateur's bonus relative to the bonus in the other monarchies in each year, with years rescaled relative to year of reform
* calculate deviations only for years in which at least two governments form
binscatter dev2bonus yrrel if monarchy&meanover!=mrbonus,rd(0) ytitle("Deviation") xtitle("Year relative to year of reform")


* parallel trends?
regress dev2bonus yrrel if country=="Belgium"&yrrel>-30&yrrel<0&meanover!=mrbonus
regress dev2bonus yrrel if country=="Denmark"&yrrel>-30&yrrel<0&meanover!=mrbonus
regress dev2bonus yrrel if country=="Netherlands"&yrrel>-30&yrrel<0&meanover!=mrbonus
regress dev2bonus yrrel if country=="Norway"&yrrel>-30&yrrel<0&meanover!=mrbonus
regress dev2bonus yrrel if country=="Sweden"&yrrel>-30&yrrel<0&meanover!=mrbonus
regress dev2bonus yrrel if country=="Iceland"&yrrel>-30&yrrel<0&meanover!=mrbonus

regress dev2bonus yrrel if monarchy&country!="Luxembourg"&yrrel>-30&yrrel<0&meanover!=mrbonus

* The results are similar using smoothed annual means, except that Belgium does show a decline prior to 1935
* calculate deviations using a smoothed estimate of the bonus in the monarchies
quietly lowess overrep year if monarchy,gen(estbonus)
gen devm = overrep - estbonus

regress devm yrrel if country=="Belgium"&yrrel>-30&yrrel<0
regress devm yrrel if country=="Denmark"&yrrel>-30&yrrel<0
regress devm yrrel if country=="Netherlands"&yrrel>-30&yrrel<0
regress devm yrrel if country=="Norway"&yrrel>-30&yrrel<0
regress devm yrrel if country=="Sweden"&yrrel>-30&yrrel<0
regress devm yrrel if country=="Iceland"&yrrel>-30&yrrel<0

regress devm yrrel if monarchy&country!="Luxembourg"&yrrel>-30&yrrel<0
